/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.sigu.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Usuario2
 */
@Embeddable
public class AlumnosPeriodosPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "institucion")
    private int institucion;
    @Basic(optional = false)
    @Column(name = "periodo")
    private String periodo;
    @Basic(optional = false)
    @Column(name = "alumno")
    private String alumno;

    public AlumnosPeriodosPK() {
    }

    public AlumnosPeriodosPK(int institucion, String periodo, String alumno) {
        this.institucion = institucion;
        this.periodo = periodo;
        this.alumno = alumno;
    }

    public int getInstitucion() {
        return institucion;
    }

    public void setInstitucion(int institucion) {
        this.institucion = institucion;
    }

    public String getPeriodo() {
        return periodo;
    }

    public void setPeriodo(String periodo) {
        this.periodo = periodo;
    }

    public String getAlumno() {
        return alumno;
    }

    public void setAlumno(String alumno) {
        this.alumno = alumno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) institucion;
        hash += (periodo != null ? periodo.hashCode() : 0);
        hash += (alumno != null ? alumno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AlumnosPeriodosPK)) {
            return false;
        }
        AlumnosPeriodosPK other = (AlumnosPeriodosPK) object;
        if (this.institucion != other.institucion) {
            return false;
        }
        if ((this.periodo == null && other.periodo != null) || (this.periodo != null && !this.periodo.equals(other.periodo))) {
            return false;
        }
        if ((this.alumno == null && other.alumno != null) || (this.alumno != null && !this.alumno.equals(other.alumno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.upc.sigu.entities.AlumnosPeriodosPK[institucion=" + institucion + ", periodo=" + periodo + ", alumno=" + alumno + "]";
    }

}
